<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<script src="js/jquery.js"></script>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<script src="js/jquery.min.js"></script>
	<style type="text/css">
		.nav-title{
			line-height: 50px ;
			color: white;
			text-align: center;
			font-size: 18px;
		}
		.glyphicon{
			top:17px;
		}
	</style>
</head>
<body>
    <nav class="navbar navbar-inverse" role="navigation">
    <div class="container nav-title">
    	<span class="glyphicon glyphicon-chevron-left pull-left"></span>
    	<span >个人资料</span>
    </div>
    </nav>
      <div class="container">
   <form role="form">
  <div class="form-group">
    <input type="file"  name="photo" >
  </div>
  <button type="submit" class="btn btn-success">上传图片</button>
  </form>
      </div>

</body>
<script type="text/javascript">
	 $('form').submit(function(e){
	e.preventDefault()
	var datas = new FormData(this)
	$.post({
		url:'/user/photo',
		data:datas,
		contentType:false,
		processData:false,
		success:function(data){
			console.log(data)
			if (data.code == 'success') {
				alert(data.message)
				location.href='index.html'
				
			} else{
				alert(data.message)
			}
		}
	})
	
})
</script>
    
        <script src="js/bootstrap.min.js"></script>
        <script src="js/jquery.cookie.js"></script>
        <script src="js/uer.js"></script>
</html>